class Ap < ActiveRecord::Base
  validates :title, presence: true
  mount_uploader :image, ApsUploader

  def place_name
    if self.place == 0
      return '上部'
    else
    	if self.place == 1
    		return '中部'
    	else 
    		return '底部'
    	end
    end
  end

  def isopen_str
    if self.isopen == false
      return '关闭'
    else
      return '开启'
    end
  end

end
